//
//  MyViewController.m
//  Travel_M_Travel
//
//  Created by Sun on 15/4/6.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "MyViewController.h"
#import "UIColor+AddColor.h"
#import "UserViewController.h"
#import "WeViewController.h"
@interface MyViewController ()


@end

@implementation MyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    NSLog(@"我的页面");
    self.view.backgroundColor = [UIColor colorFromHexCode:@"#cde6c7"];
    
    
    // 头图
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, 150)];
    imageView.backgroundColor = [UIColor whiteColor];
    imageView.image = [UIImage imageNamed:@"主题.jpg"];
    [self.view addSubview:imageView];
    [imageView release];
    
    
    // 设置
    UIButton *setButton = [UIButton buttonWithTitle:@"设    置" frame:CGRectMake(0, 244, self.view.frame.size.width, 30) target:self action:@selector(installButtonAction:)];
    setButton.backgroundColor = [UIColor colorFromHexCode:@"afb4db"];
    [self.view addSubview:setButton];
    
    // 清除缓存
    UIButton *cleanButton = [UIButton buttonWithTitle:@"清除缓存" frame:CGRectMake(0, 304, self.view.frame.size.width, 30) target:self action:@selector(cleanButtonAction:)];
    cleanButton.backgroundColor = [UIColor colorFromHexCode:@"afb4db"];
    [self.view addSubview:cleanButton];
    
    // 用户反馈
    UIButton *userButton = [UIButton buttonWithTitle:@"用户反馈" frame:CGRectMake(0, 364, self.view.frame.size.width, 30) target:self action:@selector(userButtonAction:)];
    userButton.backgroundColor = [UIColor colorFromHexCode:@"afb4db"];
    [self.view addSubview:userButton];
    
    // 关于我们
    UIButton *aboutWeButton = [UIButton buttonWithTitle:@"关于我们" frame:CGRectMake(0, 424, self.view.frame.size.width, 30) target:self action:@selector(aboutWeButtonAction:)];
    aboutWeButton.backgroundColor = [UIColor colorFromHexCode:@"afb4db"];
    [self.view addSubview:aboutWeButton];
    
}
                           
- (void) installButtonAction:(UIButton *)button
{
    NSLog(@"wowa");
}


- (void) cleanButtonAction:(UIButton *) button
{
    UIAlertView *cleanAlter = [[UIAlertView alloc]initWithTitle:@"提示" message:@"成功清除2.03MB" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    [cleanAlter show];
}

- (void) userButtonAction: (UIButton *) button
{
    UserViewController *userVC = [[UserViewController alloc] init];
    [self.navigationController pushViewController:userVC animated:YES];
    [userVC release];
}


- (void) aboutWeButtonAction: (UIButton *) button
{
    WeViewController *weVC = [[WeViewController alloc] init];
    [self.navigationController pushViewController:weVC animated:YES];
    [weVC release];
}
                           

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
